package com.yanqu.road.server.cmd.banquet.crossBanquet;

import com.yanqu.road.pb.banquet.CrossBanquetProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.manger.banquet.CrossBanquetMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.GameProtocol;

@Cmd(code = GameProtocol.S_BANQUET_CROSS_ENTER_NEXT,desc = "下一场宴会")
public class NextCrossBanqeutCmd extends AbstractCommand {
    private int pageNum;
    private int pageSize;
    private String curBanquetId;
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        CrossBanquetProto.BanquetEnterNextReq req = CrossBanquetProto.BanquetEnterNextReq.parseFrom(packet.getBytes());
        pageNum = req.getGroupId();
        pageSize = req.getGroupNum();
        curBanquetId = req.getBanquetId();
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        CrossBanquetMgr.enterNextBanquet(player,curBanquetId, pageNum, pageSize);
    }

    @Override
    public void sendData(GamePlayer player) {

    }


}
